<form name="altEditor-form" role="form" id="userForm" th:object="${userform}" th:action="@{/saveuser}" method="post">
					
			<input type='hidden' class='primarykey' id="idUserMonitoriza" th:field="*{idUserMonitoriza}">
			
			<div class="form-group">
				
					<label for="name" class="col-form-label" th:text="#{form.user.name}"></label>
					<script th:inline="javascript">
						/*<![CDATA[*/
						    var messageName = /*[[#{form.user.name.pattern}]]*/ 'default';
						/*]]>*/
					</script>
					<input onblur="validate(this,messageName);" type="text" name="nameAdd" id="nameAdd" th:field="*{name}" class="form-control" pattern=".{3,15}" required />
					<div id="invalid-nameAdd" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
			
			<div class="form-group">
				
					<label for="surnames" class="col-form-label" th:text="#{form.user.surnames}"></label>
					<script th:inline="javascript">
						/*<![CDATA[*/
						    var messageSurname = /*[[#{form.user.surnames.pattern}]]*/ 'default';
						/*]]>*/
					</script>
					<input onblur="validate(this,messageSurname);" type="text" name="surnamesAdd" id="surnamesAdd" th:field="*{surnames}" class="form-control" required pattern=".{3,30}"/>
					<div id="invalid-surnamesAdd" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
			
			<div class="form-group">
				
					<label for="login" class="col-form-label" th:text="#{form.user.login}"></label>
					<script th:inline="javascript">
						/*<![CDATA[*/
						    var messageLogin = /*[[#{form.user.login.pattern}]]*/ 'default';
						/*]]>*/
					</script>
					<input onblur="validate(this,messageLogin);" type="text" name="loginAdd" id="loginAdd" th:field="*{login}" style="overflow:hidden" class="form-control" required pattern=".{5,30}"/>
					<div id="invalid-loginAdd" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
			
			<div class="form-group">
				
					<label for="password" class="col-form-label" th:text="#{form.user.password}"></label>
					<script th:inline="javascript">
						/*<![CDATA[*/
						    var messagePassword = /*[[#{form.user.password.pattern}]]*/ 'default';
						/*]]>*/
					</script>
					<input type="password" style="display:none">
					<input onblur="validate(this,messagePassword);" type="password" name="passwordAdd" id="passwordAdd" th:field="*{password}" class="form-control" pattern=".{7,30}" required />
					<div id="invalid-passwordAdd" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
			
			<div class="form-group">
				
					<label for="confirmPassword" class="col-form-label" th:text="#{form.user.confirmPassword}"></label>
					<input onblur="validateConfirmPassword();" type="password" name="confirmPassword" id="confirmPasswordAdd" th:field="*{confirmPassword}" class="form-control" pattern=".{7,30}" required />
					<div id="invalid-confirmPassword" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
			
			<div class="form-group">
				
					<label for="email" class="col-form-label" th:text="#{form.user.email}"></label>
					<script th:inline="javascript">
						/*<![CDATA[*/
						    var messageEmail = /*[[#{form.user.email.pattern}]]*/ 'default';
						/*]]>*/
					</script>
					<input onblur="validate(this,messageEmail);" type="email" name="emailAdd" id="emailAdd" th:field="*{email}" style="overflow:hidden" class="form-control" required/>
					<div id="invalid-emailAdd" class="invalid-modal" ></div>
				
				<div style="clear:both;"/>
			</div>
							
</form>

<script th:inline="javascript">

function validateConfirmPassword(){
	
	var pass = $('#passwordAdd').val();
    var repass = $('#confirmPasswordAdd').val();
	var messageConfirmPassword = /*[[#{form.user.confirmPassword.pattern}]]*/ 'default';
	
	if(($('#passwordAdd').val().length == 0) || ($('#confirmPasswordAdd').val().length == 0)){
		$('#invalid-confirmPassword').html(messageConfirmPassword);
		$('#invalid-confirmPassword').addClass("invalid-modal");
    }
    else if (pass != repass) {
    	$('#invalid-confirmPassword').html(messageConfirmPassword);
		$('#invalid-confirmPassword').addClass("invalid-modal");
    }
    else {
    	$('#invalid-confirmPassword').html('');
		$('#invalid-confirmPassword').removeClass("invalid-modal");
    }
	
}

</script>